package thinkingJava.chapter14;

class Building {}
class House extends Building {}
public class ClassCast {
	public static void main(String[] args) {
		Building b = new House();
		Class<House> classType = House.class;
		House h = classType.cast(b);
		System.out.println(h.getClass().getSimpleName());
		h = (House) b;
		System.out.println(classType.asSubclass(House.class));
	}
}
